package com.dhl.fin.api.service.cronService;

import com.dhl.fin.api.domain.RemindTask;
import org.springframework.stereotype.Service;

/**
 * @author CuiJianbo
 * @since 2025/5/5
 */
@Service
public class EveryWeekCron implements RemindCron {

    @Override
    public String calculateCron(RemindTask remindTask) {
        String weeks = remindTask.getTargetWeek();
        String[] remindTime = remindTask.getRemindTime().split(":");
        return String.format("0 %s %s ? * %s ", remindTime[1], remindTime[0], weeks);
    }

}
